// 只拷贝目标对象中有的属性
export function copyMatchingProperties<T extends object, S extends object>(
  target: T,
  source: S,
): T {
  Object.keys(target).forEach((key) => {
    if (Object.prototype.hasOwnProperty.call(source, key)) {
      (target as any)[key] = (source as any)[key];
    }
  });
  return target;
}
